<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Admin SCI SO</title>
    <link rel="shortcut icon" href="favicon.ico" />
    <link href="{{URL::to('/css/style.css')}}" rel="stylesheet" />
    <link href="{{URL::to('/css/bootstrap.css')}}" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" media="screen" href="{{URL::to('/css/bootstrap-datetimepicker.css')}}" />

    <script type="text/javascript" src="{{URL::to('/js/jquery-2.1.1.min.js')}}"></script>

    <!-- Add custom CSS here -->
    <link href="{{URL::to('css/sb-admin.css')}}" rel="stylesheet" />
    <link rel="stylesheet" href="{{URL::to('font-awesome/css/font-awesome.min.css')}}" />
    <script type="text/javascript">
        function check_all(input_name, start) {
            master = document.getElementById(input_name);
         
            i = start;
            input_element = input_name + "_"+ i;
            input_obj = document.getElementById(input_element);
            while(input_obj != null)
            {
                input_obj = document.getElementById(input_element);
                input_obj.checked = master.checked;
         
                i = i + 1;
                input_element = input_name + "_"+ i;
                input_obj = document.getElementById(input_element);
            }
        }
         
        function check_parent(parent_id, child_id) {
            if(child_id.checked) {
                parent_id.checked = true;
            }
        }

     </script>
     <?php
      $in = DB::table('sys_order')
            ->where('order_status','=','Pending')
            ->count();
      $ap = DB::table('sys_order')
            ->where('order_status','=','Approve')
            ->count();
      $on = DB::table('sys_order')
            ->where('order_status','=','On Process')
            ->count();
      $fn = DB::table('sys_order')
            ->where('order_status','=','Finished')
            ->count();
      $de = DB::table('sys_order')
            ->where('order_status','=','Delivered')
            ->count();
      $ca = DB::table('sys_order')
            ->where('order_status','=','Cancel')
            ->count();
     ?>
  </head>

  <body style="background: url({{URL::to('/images/bg.png')}}) repeat;">

    <div id="wrapper">
     
      <!-- Sidebar -->
      <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a href="{{URL::to('/dashboard')}}" class="navbar-brand"><i class="fa fa-home"></i> Admin</a>
        </div>
        <!-- Collect the nav links, forms, and other content for toggling -->
           
        <div class="collapse navbar-collapse navbar-ex1-collapse">
          <ul class="nav navbar-nav side-nav">
               <li class="dropdown"  id="accordion">
                <a href="{{URL::to('/dashboard')}}">
                <div class="row" style="width:164px; margin-left:-6px"><div class="col-md-2"><i class="fa fa-home "></i></div><div class="col-md-9"> Dashboard</div></div>
                </a>

                @if(Session::get('admin_admin_group_id')==0)
                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseZero">
                    
                          <div class="row" style="width:164px; margin-left:-6px"><div class="col-md-2"><i class="fa fa-th "></i></div><div class="col-md-9"> Master data <b class="caret"></b></div></div>
                      </a>
                     <div id="collapseZero" class="collapse <?php if(Request::segment(1)=='master' OR Request::segment(1)=='bonus'  OR Request::segment(1)=='idcard' OR Request::segment(1)=='packaging' OR Request::segment(1)=='brosur' OR Request::segment(1)=='tshirt' OR Request::segment(1)=='nota'){ echo "in"; } ?>">
                        <ul class="nav">
                       <li>
                            <a href="{{URL::to('/master/papers')}}">
                              <div class="row" style="width:164px; margin-left:-6px"><div class="col-md-1 col-md-offset-1"><i class="fa  fa-file-o"></i></div><div class="col-lg-8">Kertas</div></div></a></li>
                          <li>
                            <a href="{{URL::to('/master/addfeatures')}}">
                              <div class="row" style="width:164px; margin-left:-6px"><div class="col-md-1 col-md-offset-1"><i class="fa fa-plus-square"></i></div><div class="col-lg-8">Tambahan</div></div></a></li>
                      
                          <li>
                            <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
                          
                                <div class="row" style="width:164px; margin-left:-6px"><div class="col-md-1 col-md-offset-1"><i class="fa fa-credit-card"></i></div><div class="col-lg-8"> ID Card <b class="caret"></b></div></div>
                            </a>
                           <div id="collapseOne" class="collapse <?php if(Request::segment(1)=='idcard'){ echo "in"; } ?>">
                              <ul class="nav">
                                <li><a href="{{URL::to('/idcard/idcardtype')}}"><div class="row" style="width:164px; margin-left:-6px"><div class="col-md-8 col-md-offset-2">Type (Jenis)</div></div></a></li>
                                <li><a href="{{URL::to('/idcard/idcardquality')}}"><div class="row" style="width:164px; margin-left:-6px"><div class="col-md-8 col-md-offset-2">Kualitas</div></div></a></li>
                            </ul>
                            </div>
                          </li>   
                          <li>   
                               <a href="{{URL::to('/brosur')}}">
                                <div class="row" style="width:164px; margin-left:-6px"><div class="col-md-1 col-md-offset-1"><i class="fa fa-ticket"></i></div><div class="col-lg-8"> Brosur </div></div>
                            </a>
                          </li>   
                       <li>   
                                 <a  href="{{URL::to('/packaging')}}">
                                  <div class="row" style="width:164px; margin-left:-6px"><div class="col-md-1 col-md-offset-1"><i class="fa fa-archive"></i></div><div class="col-lg-8"> Packaging</div></div>
                            </a>
                          </li>   
                          <li>   
                               <a href="{{URL::to('/tshirt')}}">
                                <div class="row" style="width:164px; margin-left:-6px"><div class="col-md-1 col-md-offset-1"><i class="fa fa-user"></i></div><div class="col-lg-8">T-Shirt</b></div></div>
                            </a>
                          <li>   


                               <a href="{{URL::to('/nota')}}">
                                <div class="row" style="width:164px; margin-left:-6px"><div class="col-md-1 col-md-offset-1"><i class="fa fa-money"></i></div><div class="col-lg-8"> Nota </div></div>
                            </a>
                          </li>   

                            <li>   


                               <a href="{{URL::to('/bonus')}}">
                                <div class="row" style="width:164px; margin-left:-6px"><div class="col-md-1 col-md-offset-1"><span class="fa fa-gear"></span></div><div class="col-lg-8"> Bonus Conf</div></div>
                            </a>
                          </li>  

                      </ul>
                      </div>
                      @endif


                      <a data-toggle="collapse" data-parent="#accordion" href="#collapseSix">
                    
                          <div class="row" style="width:164px; margin-left:-6px"><div class="col-md-2"><i class="fa fa-list "></i></div><div class="col-md-6"> Order <b class="caret"></b></div></div>
                      </a>
                     <div id="collapseSix" class="collapse <?php if(Request::segment(1)=='order'){ echo "in"; } ?>">
                        <ul class="nav">
                          <li><a href="{{URL::to('/order/incomingorder')}}"><div class="row" style="width:164px; margin-left:0px"><div class="col-lg-1"><span class="fa fa-inbox"></span></div><div class="col-lg-9"> Incoming <span class="badge">{{$in}}</span></div></div></a></li>
                          <li><a href="{{URL::to('/order/approvingorder')}}"><div class="row" style="width:164px; margin-left:0px"><div class="col-lg-1"><span class="fa fa-sign-in"></span></div><div class="col-lg-9"> Approve <span class="badge">{{$ap}}</span></div></div></a></li>
                          <li><a href="{{URL::to('/order/onprocessorder')}}"><div class="row" style="width:164px; margin-left:0px"><div class="col-lg-1"><span class="fa fa-gear"></span></div><div class="col-lg-9"> Process <span class="badge">{{$on}}</span></div></div></a></li>
                          <li><a href="{{URL::to('/order/finishedorder')}}"><div class="row" style="width:164px; margin-left:0px"><div class="col-lg-1"><span class="fa fa-check-square-o"></span></div><div class="col-lg-9"> Finished <span class="badge">{{$fn}}</span></div></div></a></li>
                          <li><a href="{{URL::to('/order/deliveredorder')}}"><div class="row" style="width:164px; margin-left:0px"><div class="col-lg-1"><span class="fa fa-upload"></span></div><div class="col-lg-9"> Delivered <span class="badge">{{$de}}</span></div></div></a></li>
                          <li><a href="{{URL::to('/order/canceledorder')}}"><div class="row" style="width:164px; margin-left:0px"><div class="col-lg-1"><span class="fa fa-times"></span></div><div class="col-lg-9"> Canceled <span class="badge">{{$ca}}</span></div></div></a></li>
                      </ul>
                      </div>

                  


                       <a href="{{URL::to('/agen')}}">
                      <div class="row" style="width:164px; margin-left:-6px"><div class="col-md-2"><span class="fa fa-users"></span></div><div class="col-lg-9"> Daftar agen</div></div>
                      </a>




                      <a href="{{URL::to('/pesanproduk')}}">
                      <div class="row" style="width:164px; margin-left:-6px"><div class="col-md-2"><i class="fa fa-pencil-square-o "></i></div><div class="col-md-9"> Pesan produk</div></div>
                      </a>


                      <a data-toggle="collapse" data-parent="#accordion" href="#collapseSeven">
                    
                          <div class="row" style="width:164px; margin-left:-6px"><div class="col-md-2"><i class="fa fa-file-text-o "></i></div><div class="col-md-8"> Laporan <b class="caret"></b></div></div>
                      </a>
                     <div id="collapseSeven" class="collapse <?php if(Request::segment(1)=='report'){ echo "in"; } ?>">
                        <ul class="nav">
                          <li><a href="{{URL::to('/report/order')}}"><div class="row" style="width:164px; margin-left:-6px"><div class="col-md-1 col-md-offset-1"><span class="fa fa-inbox"></span></div><div class="col-lg-8"> Order</div></div></a></li>
                          <li><a href="{{URL::to('/report/status')}}"><div class="row" style="width:164px; margin-left:-6px"><div class="col-md-1 col-md-offset-1"><span class="fa fa-pencil"></span></div><div class="col-lg-8"> Status</div></div></a></li>
                          <li><a href="{{URL::to('/report/produk')}}"><div class="row" style="width:164px; margin-left:-6px"><div class="col-md-1 col-md-offset-1"><span class="fa fa-archive"></span></div><div class="col-lg-8"> Produk</div></div></a></li>
                          @if(Session::get('admin_admin_group_id')==0)
                          <li><a href="{{URL::to('/report/bonus')}}"><div class="row" style="width:164px; margin-left:-6px"><div class="col-md-1 col-md-offset-1"><span class="fa fa-money"></span></div><div class="col-lg-8"> Bonus</div></div></a></li>
                          <li><a href="{{URL::to('/report/agen')}}"><div class="row" style="width:164px; margin-left:-6px"><div class="col-md-1 col-md-offset-1"><span class="fa fa-users"></span></div><div class="col-lg-8"> Agen</div></div></a></li>
                          @endif
                      </ul>
                      </div>
                      @if(Session::get('admin_admin_group_id')==0)
                      <a href="{{URL::to('/admin/accountlist')}}">
                      <div class="row" style="width:164px; margin-left:-6px"><div class="col-md-2"><i class="fa fa-user "></i></div><div class="col-md-9"> Daftar account</div></div>
                      </a>
                      @endif

                       <a href="{{URL::to('/admin/logout')}}">
                        <div class="row" style="width:164px; margin-left:-6px"><div class="col-md-2"><i class="fa fa-power-off "></i></div><div class="col-md-9"> Logout <span class="badge"></span></div></div>
                      </a>

              </li>


          </ul>



          <ul class="nav navbar-nav navbar-right navbar-user">
            <li class="dropdown user-dropdown">
                  <a href="#" class="dropdown-toggle" data-toggle="dropdown"><button class="btn bnt-lg btn-users">Selamat datang, <label>{{Session::get('admin_name')}}  </label> <b class="caret"></b> </button></a>

                  
              <ul class="dropdown-menu">
                <li><a href="{{URL::to('/admin/profile')}}"><i class="fa fa-user"></i> Profile</a></li>
                <li><a href="{{URL::to('/order/incomingorder')}}"><i class="fa fa-envelope"></i> Inbox <span class="badge">{{$in}}</span></a></li>
                @if(Session::get('admin_admin_group_id')==0)
                <li><a href="{{URL::to('/admin/accountlist')}}"><i class="fa fa-users"></i> Daftar ccount</a></li>
                @endif
                <li class="divider"></li>
                <li><a href="{{URL::to('/admin/logout')}}"><i class="fa fa-power-off"></i> Log Out <span class="badge"></span></a></li>
              </ul>
            </li>
          </ul>
        </div><!-- /.navbar-collapse -->
      </nav>

      <div id="page-wrapper">

        @if(Session::has('message'))
          <div class="alert alert-success" align="center">  <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
          {{Session::get('message')}}
          </div>
        @endif
        
        @if(Session::has('error'))
          <div class="alert alert-danger" align="center">  <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
          {{Session::get('error')}}
          </div>
        @endif

      @yield('content')

      </div><!-- /#page-wrapper -->

    <nav class="navbar navbar-default  navbar-fixed-bottom" role="navigation">
      <div class="container">
       <div class="footer"><p align="center"><img id="footer-fix" src="{{URL::to('images/ESD Logo - New.png')}}" /></p></div>
      </div>
    </nav>
    </div><!-- /#wrapper -->

    

    <!-- JavaScript -->
    <script src="{{URL::to('/js/jquery-2.1.1.min.js')}}"></script>
    <script src="{{URL::to('/js/bootstrap-datetimepicker.js')}}"></script>
    <script src="{{URL::to('/js/bootstrap.min.js')}}"></script>
    <script type="text/javascript" src="{{URL::to('/js/moment.js')}}"></script>
    <script type="text/javascript" src="{{URL::to('/js/bootstrap-datetimepicker.js')}}"></script>
    <script src="{{URL::to('/js/highcharts.js')}}"></script>
    <script src="{{URL::to('/js/exporting.js')}}"></script>
   

  </body>
</html>
